[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+--------+#################################################################
#+-| PROMPT |-------------------------------------------------------+#########
#| +--------+ The PROMPT subcommand prints the character string to |#########
#| the device selected by the SET DEVICE TO command |#########
#+------------------------------------------------------------------+#########
##############################################################################
##############################################################################
#+--| Syntax |-------------------------------------------------+##############
#| @<Int-exp,Int-exp> PROMPT <C-exp> [MESSAGE <C-exp>] |##############
#| [ ID <Uint-exp> ] |##############
#+-------------------------------------------------------------+##############
##############################################################################
##############################################################################
#########+---| Description |----------------------------------------+#########
#########| The PROMPT subcommand prints the character string to the |#########
#########| device selected by the SET DEVICE TO command. The |#########
#########| string is positioned at the specified coordinates and |#########
#########| refered to a menu selection pad. |#########
#########| -------------------------------------------------------- |#########
#########| PROMPT also builds an internal menu structure for use by |#########
#########| the MENU TO command. PROMPT allocates memory and |#########
#########| optionally assigns an ID number and a MESSAGE to the |#########
#########| selection. Messages are displayed at the position |#########
#########| specified by SET MESSAGE TO when selections are |#########
#########| highlighted. |#########
#########| -------------------------------------------------------- |#########
#########| If an ID clause is not given for a PROMPT, the ID is |#########
#########| assigned based on the number of PROMPT commands which |#########
#########| have been executed. |#########
#########| The default ID for the first prompt is 1. |#########
#########| -------------------------------------------------------- |#########
#########| The ON SELECTION DO subcommand of MENU TO specifies a |#########
#########| procedure that is executed when a menu selection pad is |#########
#########| highlighted. Menu prompts are cleared unless the SAVE |#########
#########| clause is used in MENU TO. |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Messages do NOT need to be specified. |#########
#########| |#########
#########| @ r, c PROMPT "Start" |#########
#########| @ r, c+8 PROMPT "Stop" |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Use arrays to initialize prompts. This makes |#########
#########| * it easier to maintain and support. |#########
#########| |#########
#########| #define NA 6 |#########
#########| VARDEF |#########
#########| CHAR(10) p[&NA]="Edit","Append","Goto",; |#########
#########| "Find","delete","Quit" |#########
#########| ENDDEF |#########
#########| |#########
#########| {...} |#########
#########| c = 3 |#########
#########| FOR r = 1 TO &NA |#########
#########| @ 1,c PROMPT p[r-1] ID r |#########
#########| *--- have 3 spaces between each prompt |#########
#########| |#########
#########| c = c+len(p[r-1])+3 |#########
#########| |#########
#########| NEXT |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 3 |-------------------------------------------+#########
#########| * Prompt with message and id. |#########
#########| |#########
#########| @ 10,2 PROMPT "One" MESSAGE c[m] ID 6 |#########
#########| @ 11,2 PROMPT "Two" MESSAGE c[m+1] ID 7 |#########
#########| {...} |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 4 |-------------------------------------------+#########
#########| * Isolated prompt commands for a vertical menu. |#########
#########| |#########
#########| #INCLUDE keys.hdr |#########
#########| #INCLUDE string.hdr |#########
#########| |#########
#########| #DEFINE AR_ACCT 10 |#########
#########| #DEFINE AR_TRAN 11 |#########
#########| #DEFINE AR_INVC 12 |#########
#########| #DEFINE AR_PROD 13 |#########
#########| #DEFINE AR_EXIT 14 |#########
#########| {...} |#########
#########| SET MESSAGE TO 24 |#########
#########| |#########
#########| @ 3,10 PROMPT "Account maintenance" MESSAGE ; |#########
#########| "Maintenance of accounts & customer info." ; |#########
#########| ID &AR_ACCT |#########
#########| |#########
#########| @ 5,10 PROMPT "Transaction maintenance" MESSAGE ; |#########
#########| "Maintenance of payments, and charges." ; |#########
#########| ID &AR_TRAN |#########
#########| |#########
#########| @ 7,10 PROMPT "Invoice maintenance" MESSAGE ; |#########
#########| "Order and Invoice maintenance screen." ; |#########
#########| ID &AR_INVC |#########
#########| |#########
#########| @ 9,10 PROMPT "Product maintenance" MESSAGE ; |#########
#########| "Product list maintenance for invoicing." ; |#########
#########| ID &AR_PROD |#########
#########| |#########
#########| @11,10 PROMPT "Exit Accts Receivable" MESSAGE ; |#########
#########| "Exit to main accounting menu. ; |#########
#########| Close daily journal." ; |#########
#########| ID &AR_EXIT |#########
#########| |#########
#########| idx = &AR_ACCT |#########
#########| |#########
#########| REPEAT |#########
#########| |#########
#########| MENU TO idx SAVE |#########
#########| keyn = lastkey() |#########
#########| |#########
#########| IF keyn < 128 |#########
#########| posit = at(chr(keyn), "AaTtIiPpjEe" |#########
#########| IF posit > 0 |#########
#########| idx = posit + &AR_ACCT - 1 |#########
#########| keyn = &K_ENTER |#########
#########| ENDIF |#########
#########| ENDIF |#########
#########| |#########
#########| IF keyn = &K_ENTER |#########
#########| DO CASE |#########
#########| CASE idx = &AR ACCT |#########
#########| RUN "ARACCT.EXE" |#########
#########| |#########
#########| CASE idx = &AR TRAN |#########
#########| RUN "ARTRAN.EXE" |#########
#########| |#########
#########| CASE idx = &AR INVC |#########
#########| RUN "ARINVC.EXE" |#########
#########| |#########
#########| CASE idx = &AR PROD |#########
#########| RUN "ARPROD.EXE" |#########
#########| |#########
#########| CASE idx = &AR EXIT |#########
#########| EXIT |#########
#########| ENDCASE |#########
#########| ENDIF |#########
#########| |#########
#########| UNTIL keyn = &K_ESC |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
CLEAR MENU
MENU TO
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson